home *** CD-ROM | disk | FTP | other *** search
/ Menu Planner / Menu Planner (Ohio Distinctive Software).ISO / pc / mp.dir / 00037_calories.ls < prev    next >
Encoding:
Text File  |  1995-11-07  |  779 b   |  35 lines

  1. on keyDown
  2.   global gDirty
  3.   set gDirty to 1
  4.   put the key && charToNum(the key)
  5.   if the key = TAB then
  6.     if validatePDCScreen() then
  7.       if the machineType = 256 then
  8.         set the editableText of sprite 19 to 1
  9.         hilite field "meals"
  10.       else
  11.         pass()
  12.       end if
  13.     end if
  14.   else
  15.     if the key = BACKSPACE then
  16.       pass()
  17.     else
  18.       if (charToNum(the key) > charToNum("9")) or (charToNum(the key) < charToNum("0")) then
  19.         dontPassEvent()
  20.       else
  21.         if (charToNum(the key) <= charToNum("9")) or (charToNum(the key) >= charToNum("0")) then
  22.           pass()
  23.         end if
  24.       end if
  25.     end if
  26.   end if
  27. end
  28.  
  29. on keyUp
  30.   global calcdata
  31.   set DDC to integer(field "calories")
  32.   setaProp(calcdata, #desired_calories, DDC)
  33.   pass()
  34. end
  35.